{layout name="layout" /}
<!-- Main content -->

    <div class="box box-default">
        <div class="box-header with-border">
            {if condition="isset($data.id)"}
            <h3 class="box-title">修改菜单信息</h3>
            {else /}
            <h3 class="box-title">录入菜单信息</h3>
            {/if}
        </div>
        <div class="row">
            <div class="col-xs-12">
                <form class="form-horizontal ingeAjax" method="post" action="{if condition="isset($data.id)"}{:url('home/Menu/homeGoEdit','id='.$data['id'])}{else /}{:url('home/Menu/homeGoAdd')}{/if}">
                    <div class="space-2"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 上级:</label>
                        <div class="col-sm-10">
                            <select name="menu_pid" class="select2 form-group-new  col-xs-12 col-sm-4">
                                <option value="0">作为顶级菜单</option>
                                {$menulist}
                            </select>
                         </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 名称： </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="输入名称" required/ name="name" value="{$data.name|default=''}">
                            <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red">*</span>必填</span>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 应用： </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="输入应用" required/ name="model" value="{$data.model|default=''}">
                            <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red">*</span>必填</span>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 控制器： </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="输入控制器" required/ name="controller" value="{$data.controller|default=''}">
                            <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red">*</span>必填</span>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 方法： </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="输入方法" required/  name="action" value="{$data.action|default=''}">
                            <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red">*</span>必填</span>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 参数： </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="输入参数" name="data" value="{$data.data|default=''}">
                            <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red"></span>例:id/3/p/3</span>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 图标： </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="输入图标"  name="icon" value="{$data.icon|default=''}">
                            <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red"></span></span>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 备注： </label>
                        <div class="col-sm-10">
                            <textarea class="form-group-new col-xs-12 col-sm-4" name="remark" placeholder="输入备注">{$data.remark|default=''}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 是否启用： </label>
                        <div class="col-sm-10">
                        {if condition="isset($data.id)"}
                        {if condition="$data.status eq 1"}<input type="checkbox" name="status" class="flat-blue" checked>{else /}<input type="checkbox" name="status" class="flat-blue">{/if}
                        {else /}
                        <input type="checkbox" name="status" class="flat-blue" checked>
                        {/if}
                        </div>
                     </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 类型： </label>
                        <div class="col-sm-10">
                            <select name="type" class="select2 form-group-new  col-xs-12 col-sm-4">
                                {if condition="isset($data.id)"}
                                {if condition="$data.type eq 1"}
                                <option value="1" selected>权限认证+菜单</option>
                                <option value="0">只作为菜单</option>
                                {else /}
                                <option value="1">权限认证+菜单</option>
                                <option value="0" selected>只作为菜单</option>
                                {/if}
                                {else /}
                                <option value="1" selected>权限认证+菜单</option>
                                <option value="0">只作为菜单</option>
                                {/if}
                            </select>
                         </div>
                    </div>
                    <div class="form-actions">
                        <div class="col-md-offset-3 col-md-9">
                            <button class="btn btn-primary" type="submit">
                                <i class="fa fa-check bigger-110"></i> 保存
                            </button> &nbsp; &nbsp; &nbsp;
                            {if condition="isset($data.mb_id)"}
                            <button class="btn" type="reset" onclick="history.go(-1);">
                                <i class="fa fa-undo bigger-110"></i> 返回
                            </button>
                            {else /}
                            <button class="btn" type="reset">
                                <i class="fa fa-undo bigger-110"></i> 重置
                            </button>
                            {/if}
                        </div>
                    </div>
                    <div class="space"></div>
                </form>
            </div>
        </div>
    </div>
    <!-- /.row -->
</section>
{include file="public/base" /} {include file="public/edit" /} {include file="public/footer" /}
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="/static/plugins/datepicker/datepicker3.css">
<!-- bootstrap datepicker -->
<script src="/static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script>
    $(function() {
        $(".select2").select2();
        $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass: 'iradio_flat-green'
        });
        $('#datepicker2,#datepicker1').datepicker({
            autoclose: false,
            beforeShowDay: $.noop,
            calendarWeeks: false,
            clearBtn: false,
            daysOfWeekDisabled: [],
            endDate: Infinity,
            forceParse: true,
            format: 'yyyy-mm-dd',
            keyboardNavigation: true,
            language: 'cn',
            minViewMode: 0,
            orientation: "auto",
            rtl: false,
            startDate: -Infinity,
            startView: 0,
            todayBtn: false,
            todayHighlight: false,
            weekStart: 0
        });
    });
</script>
</body>

</html>
